/*
 * Copyright (C) 2013 tangzhi
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.tangzsoft.pdmviewer.storage.impl;

import java.util.Map;
import org.tangzsoft.pdmviewer.model.PdmObject;
import org.tangzsoft.pdmviewer.storage.PdmObjectDAO;
import org.tangzsoft.pdmviewer.storage.spi.PdmObjectDAOSPI;
import org.tangzsoft.pdmviewer.storage.spi.StorageSPI;


public class PdmObjectDAOImpl implements PdmObjectDAO {
    
    protected StorageSPI storage;
    protected PdmObjectDAOSPI spi;
    
    public PdmObjectDAOImpl(StorageSPI storage) {
        this.storage = storage;
        spi = storage.getPdmObjectDAO();
    }

    @Override
    public void create(String fileId, String name, String id, Map<String,String> attrs) {
        spi.create(fileId, name, id ,attrs);
    }

    @Override
    public PdmObject[] findDiagrams(String fileId) {
        return spi.findDiagrams(fileId);
    }

    @Override
    public PdmObject[] findTables(String fileId, String diagramId) {
        return spi.findTables(fileId, diagramId);
    }
 
}
